<template>
	<div class="son">
		<h1>我是Son组件</h1>
		<button @click="sendCar">点我把车给父亲开一下</button>
		<Grandson :house="house" :getToy="getToy"></Grandson>
	</div>
</template>

<script>
	import Grandson from './Grandson.vue'
	export default {
		name:'Son',
		components:{Grandson},
		props:['house','getCar','getToy'],
		data() {
			return {
				car:'保时捷'
			}
		},
		methods:{
			sendCar(){
				this.getCar(this.car)
			}
		}
	}
</script>

<style scoped>
	.son{
		background-color: skyblue;
		padding: 20px;
	}
</style>